package com.bwie.controller;

import com.bwie.common.domain.User;
import com.bwie.common.domain.request.LoginReq;
import com.bwie.common.domain.response.LoginResp;
import com.bwie.common.result.Result;
import com.bwie.service.SysUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;

/**
 * @className: SysUserController
 * @Description: TODO
 * @version: v1.８.0
 * @author: 郑伦
 * @date: 2025/7/31 9:57
 */
@RestController
public class SysUserController {

    //查询用户信息
    @Autowired
    SysUserService sysUserService;

    /**
     * 查询用户登录信息
     * @param loginReq
     * @return
     */
    @PostMapping("/selectUser")
    public Result<User> selectUser(@RequestBody @Valid LoginReq loginReq){
        User user = sysUserService.selectUser(loginReq);
        return Result.success(user);
    }
}